package com.zmj.sy.mom.srv.aps.controller;

import com.zmj.sy.mom.srv.aps.bean.vo.base.BaseIdReqVo;
import com.zmj.sy.mom.srv.aps.bean.vo.base.BaseResVo;
import com.zmj.sy.mom.srv.aps.bean.vo.base.BaseSelectResVo;
import com.zmj.sy.mom.srv.aps.bean.vo.phaserefactor.*;
import com.zmj.sy.mom.srv.aps.service.PhaseRefactorService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

@RequiredArgsConstructor
@Api(tags = "工序-重构")
@RestController
@RequestMapping("/phaseRefactor")
public class PhaseRefactorController {

    private final PhaseRefactorService phaseRefactorService;

    @ApiOperation("1.1.1.1 任务 - 任务选择框")
    @GetMapping("/jobSelect")
    public BaseSelectResVo jobSelect() {
        return phaseRefactorService.jobSelect();
    }

    @ApiOperation("1.1.1.2 任务 - 任务添加")
    @PostMapping("/jobAdd")
    public BaseResVo jobAdd(@RequestBody PhaseRefactorJobAddReqVo reqVo) {
        phaseRefactorService.jobAdd(reqVo);
        return BaseResVo.ok();
    }

    @ApiOperation("1.1.1.3 任务 - 任务详情")
    @GetMapping("/jobGet")
    public PhaseRefactorJobGetResVo jobGet(BaseIdReqVo reqVo) {
        return phaseRefactorService.jobGet(reqVo);
    }

    @ApiOperation("1.1.1.4 任务 - 任务修改")
    @PostMapping("/jobEdit")
    public BaseResVo jobEdit(@RequestBody PhaseRefactorJobEditReqVo reqVo) {
        phaseRefactorService.jobEdit(reqVo);
        return BaseResVo.ok();
    }

    @ApiOperation("1.1.1.5 任务 - 任务删除")
    @PostMapping("/jobDel")
    public BaseResVo jobDel(@RequestBody BaseIdReqVo reqVo) {
        phaseRefactorService.jobDel(reqVo);
        return BaseResVo.ok();
    }

    @ApiOperation("1.1.2.1 工序 - 工序下拉框")
    @GetMapping("/phaseSelect")
    public BaseSelectResVo phaseSelect() {
        return phaseRefactorService.phaseSelect();
    }

    @ApiOperation("1.1.2.2 工序 - 工序新增")
    @PostMapping("/phaseAdd")
    public BaseResVo phaseAdd(@RequestBody PhaseRefactorPhaseAddReqVo reqVo){
        phaseRefactorService.phaseAdd(reqVo);
        return BaseResVo.ok();
    }

    @ApiOperation("1.1.2.3 工序 - 工序详情")
    @GetMapping("/phaseGet")
    public PhaseRefactorPhaseGetResVo phaseGet(BaseIdReqVo reqVo) {
        return phaseRefactorService.phaseGet(reqVo);
    }

    @ApiOperation("1.1.2.4 工序 - 工序修改")
    @PostMapping("/phaseEdit")
    public BaseResVo phaseEdit(@RequestBody PhaseRefactorPhaseEditReqVo reqVo) {
        phaseRefactorService.phaseEdit(reqVo);
        return BaseResVo.ok();
    }

    @ApiOperation("1.1.2.5 工序 - 工序删除")
    @PostMapping("/phaseDel")
    public BaseResVo phaseDel(@RequestBody BaseIdReqVo reqVo) {
        phaseRefactorService.phaseDel(reqVo);
        return BaseResVo.ok();
    }

    @ApiOperation("1.1.2.8 工序任务 - 工序任务移入")
    @PostMapping("/phaseJobIn")
    public BaseResVo phaseJobIn(@RequestBody PhaseRefactorPhaseJobInReqVo reqVo) {
        phaseRefactorService.phaseJobIn(reqVo);
        return BaseResVo.ok();
    }

    @ApiOperation("1.1.2.9 工序任务 - 工序任务移出")
    @PostMapping("/phaseJobOut")
    public BaseResVo phaseJobOut(@RequestBody BaseIdReqVo reqVo) {
        phaseRefactorService.phaseJobOut(reqVo);
        return BaseResVo.ok();
    }

    @ApiOperation("1.1.2.10 工序任务 - 工序任务上移")
    @PostMapping("/phaseJobUp")
    public BaseResVo phaseJobUp(@RequestBody BaseIdReqVo reqVo) {
        phaseRefactorService.phaseJobUp(reqVo);
        return BaseResVo.ok();
    }

    @ApiOperation("1.1.2.11 工序任务 - 工序任务下移")
    @PostMapping("/phaseJobDown")
    public BaseResVo phaseJobDown(@RequestBody BaseIdReqVo reqVo) {
        phaseRefactorService.phaseJobDown(reqVo);
        return BaseResVo.ok();
    }

}
